import { reactive } from 'vue';

export const delegationStore = reactive({
  delegations: [
    {
      id: 1,
      type: '快递',
      time: '10-14 20:39发布',
      fromLocation: '榕园',
      toLocation: '荔园',
      price: 5,
    },
    {
      id: 2,
      type: '快递',
      time: '10-15 22:55发布',
      fromLocation: '榕园',
      toLocation: '槿园',
      price: 5,
    },
  ],

  addDelegation(delegation) {
    this.delegations.push({
      id: this.delegations.length + 1,
      ...delegation,
    });
  },
});
